import 'package:json_annotation/json_annotation.dart';

import '../utils/local_datetime.dart';

class LocalDateTimeConverter implements JsonConverter<LocalDateTime, String> {
  @override
  LocalDateTime fromJson(String json) {
    return LocalDateTime.ofString(json);
  }

  @override
  String toJson(LocalDateTime object) {
    return object.date.toIso8601String();
  }

  const LocalDateTimeConverter();
}
